home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
c
/
cnews004.zip
/
CNEWS004.NWS
next >
Wrap
Text File
|
1988-02-21
|
60KB
|
1,484 lines
Volume 1, Number 4 21 February 1988
+---------------------------------------------------------------+
| |
| - C News - |
| |
| International |
| C Programming & Compiler Review |
| Newsletter |
| |
+---------------------------------------------------------------+
US Office:
Editor at large Barry Lynch
Assistant Editor Ami Dworkin
Technical Editor Marshall Presnell
Australian Office:
Editor David Nugent
C News is published bi-weekly by the C BBS as its official
newsletter. You are encouraged to submit articles for publication
in C News. Articles should be related to C programming and can be
Tutorials, reviews or articles of interest to the C programming
community. All Operating systems are fairly represented and this
newsletter shows no favoritism to any one in particular. Instruct-
ions on how to submit articles for publication is included on the
last page.
C News is the property of the C BBS and is Copyright 1988 by the
the C BBS. All rights are reserved and distribution is limited to
electronic distribution and personal printed copies. C News cannot
be resold at any profit, by any organization. All material enclosed
within the newsletter is the opinions of the writers and not the
C BBS or it's Sysop.
DISTRIBUTION POINTS:
EASTERN US - C BBS 109/713 (703)998-8377
CANADA - Another BBS
AUSTRALIA - Alpha Centuri BBS
EUROPE - 150/1 - Sysop: Henk Wevers
New distribution points are always welcome, if you are interested
send me a netmail message at the above address.
C News 1-04 21 Feb 1988
=================================================================
TABLE OF CONTENTS
=================================================================
1. EDITORIAL
The Heap: messages from the editor.................... 1
New Column, User requests
2. PATCHES/MITE REPORTS
MSC Version 5.0 Bug Listings ............................. 2
3. SHORT SNIPS
Magazine Review's
by Barry Lynch ...................................... 6
4. BOOK REVIEWS
MS-DOS Developer's Guide ................................ 7
by Barry Lynch
5. SOFTWARE REVIEWS
Public Domain: .......................................... 8
SETPRGMS.ARC, SHIFT_C.ARC, SYSACT11.ARC, XENIXARC.ARC,
CDATE.ARC, C_DATES.ARC, C-SUBR.ARC, JCL-SRC.ARC, and
NDMAKE41.ARC
by David Nugent
6. FEATURE ARTICLE
Filename Wildcard Expansion in Microsoft C ............... 15
7. /Usr/Bin
by Marshall Presnell ................................. 26
8. NOTES
Article Submission Standards ............................. 28
Address's ............................................... 29
USER Response Form ....................................... 30
9. INDEX ................................................... 31
C News 1-04 Page 1 21 Feb 1988
=================================================================
EDITORIAL
=================================================================
The HEAP: Messages from the Editor.
With this issue of C News we start a new column, and begin
<hopefully> a new tradition. First, Marshall Presnell joins us
with his column the "/usr/bin". Dedicated to technical questions
and answers relating to C programming. Marshall has a BS in
Electrical Engineering and is quite a accomplished programmer in
C and ASM. Marshall's column will be a regular feature, and I
know that he will provide a valuable service to all of us in the
future.
The next feature of C News that I am proud of, and hope becomes
a regular feature. Is an article by Bill Mayne on Expanding
arguments from the command line and some other goodies. Mr. Mayne
has done an excellent job and should be congratulated by all. It
is hoped that articles like his will be forthcoming in future issues
of C News as well.
Last Issue, I included a user response form for users to fill
and send back if they had the chance. Well, quite a few users did
and I thank you for the support. Most of the suggestions dealt
with more beginner oriented tutorials and a technical question
and answer column. Both of these requests have been satisfied
in this issue, and we will attempt to keep up the quality of work
that we have been able to produce for this issue in future issues.
B C'ng U
Barry Lynch
C News 1-04 Page 2 21 Feb 1988
=================================================================
PATCHES/MITE REPORTS
=================================================================
MSC Version 5.0
Be VERY careful when using the MSC5 compiler. The optimizer is
generating a LOT of bad code in places. In some cases you can disable
enough of the optimizer to force it to generate good code, but in
other cases one must simply rewrite code to trick the compiler into
doing the write thing. The problems appear to be with large memory
models. All C code was compiler with "Alfu" memory model.
In the next two messages I will show two code samples that
generated bad code. The samples are simplified extracts that
demonstrate a compiler bug..
This demonstrates a bug in the loop optimizer. The cast to a CHAR *
is what confused the optimizer... The code is large memory model
compiled with "Alfu". The bug is correctable by disabling the loop
optimizer.
#include<stdio.h>
#define GETSEGPTR(xseg,xoff) ((char *) (((long) xseg <<16) | xoff))
#define WHATEVER 20
void
fortran
badcode(buffer,unpointer)
char *buffer;
unsigned *unpointer;
{
char *ptr;
unsigned segval, get_a_segval();
int i;
segval=get_a_segval();
for(i=0; i< WHATEVER ; i++)
{
do_something( GETSEGPTR(segval,0));
segval+=16;
}
}
It does not matter what the called routines do, The compiler does
not generate the code to add 16 (seg size) to the variable SEGVAL..
Below is the asm that the compiler generates....
C News 1-04 Page 3 21 Feb 1988
=================================================================
PATCHES/MITE REPORTS
=================================================================
MSC Version 5.0
*** 000024 be 14 00 mov si,20
*** 000027 81 46 fe 40 01 add WORD PTR [bp-2],320
;segval
$L20000:
;|*** {
; Line 20
;|*** do_something(GETSEGPTR(segval,0));
; Line 21
*** 00002c ff 76 f6 push WORD PTR [bp-10]
*** 00002f ff 76 f4 push WORD PTR [bp-12]
*** 000032 9a 00 call FAR PTR _do_something
*** 000037 83 c4 04 add sp,4
;|*** segval+=16;